package cn.magic0610.realtime;

import org.bukkit.command.PluginCommand;
import org.bukkit.plugin.Plugin;
import org.bukkit.plugin.java.JavaPlugin;

public final class Realtime extends JavaPlugin {
    public static Plugin plugin;

    @Override
    public void onEnable() {
        //插件加载时
        plugin = this;

        Functions functions = new Functions();
        functions.createConfig();
        functions.load();

        RtCommand rtCommand =new RtCommand();
        PluginCommand rt = getCommand("realtime");
        rt.setExecutor(rtCommand);
        rt.setTabCompleter(rtCommand);

        getLogger().info("Realtime enabled!");
    }

    @Override
    public void onDisable() {
        //插件卸载时
        Functions functions = new Functions();
        functions.changeDayNight(Functions.changedWorlds, true);
        getLogger().info("Realtime disabled!");
    }
}
